package repos

import javax.inject.Inject

import models.{Module, RoleModule}
import org.sedis.Pool
import play.api.db.slick.DatabaseConfigProvider
import repos.Tables.{ModuleTable, RoleModuleTable}
import slick.backend.DatabaseConfig
import slick.driver.JdbcProfile
import slick.lifted.TableQuery

class ModuleRepository @Inject()(databaseConfigProvider: DatabaseConfigProvider,
                                 pool: Pool) extends BaseRepository[Module,ModuleTable](Tables.modules, pool) {
  override protected val dbConfig: DatabaseConfig[JdbcProfile] = databaseConfigProvider.get[JdbcProfile]

}

class RoleModuleRepository @Inject()(databaseConfigProvider: DatabaseConfigProvider,
                                     pool: Pool)
  extends BaseRepository[RoleModule,RoleModuleTable](Tables.roleModules, pool) {
  override protected val dbConfig: DatabaseConfig[JdbcProfile] = databaseConfigProvider.get[JdbcProfile]
}
